package com.example.utils;

import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;

/**
 * @project: shareCar
 * @description: Md5加密工具类
 * @author: cjq
 * @create: 2022-08-09 15:59
 **/
public class Md5Utils {
    /**
     * 字符串加密
     * @param str
     * @return
     */
    public static String getMd5(String str){
        if (StringUtils.isEmpty(str)){
            str="";
        }
        return DigestUtils.md5DigestAsHex(str.getBytes());
    }
}
